package com.journey.org.ui.home.news.detail

import android.os.Bundle
import android.text.Html
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.lifecycle.Observer
import com.journey.org.BR
import com.journey.org.R
import com.journey.org.databinding.FragmentNewsDetailBinding
import com.mvvmhabit.org.base.BaseFragment

/**
 * @Date: 2020/11/23 13:32
 * @Author:小妖
 * @Description: 新闻详情
 */
class NewsDetailFragment : BaseFragment<FragmentNewsDetailBinding, NewsDetailViewModel>() {

    var id = ""

    override fun initParam() {
        super.initParam()
        id = arguments?.getString("id")!!
    }

    override fun initVariableId(): Int = BR.viewModel

    override fun initViewModel(): Class<NewsDetailViewModel> = NewsDetailViewModel::class.java

    override fun initContentView(
        inflater: LayoutInflater?,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): Int = R.layout.fragment_news_detail

    override fun initData() {
        super.initData()
        mViewModel?.onNewsIdField?.set(id)
        mViewModel?.loadNeteaseNewsDetail(id)
    }

}